#pragma once

#include <YSimpleSystem/Interface.h>
#include <YSimpleNetwork/YSimpleNetwork.h>
#include <WinSock2.h>

namespace ysimple_network
{
	class YEndPoint;
	struct ISendToCallback;
	struct IRecvFromCallback;

	struct IUDPSession
		: public ysimple_system::Interface
	{
		virtual bool				init() = 0;
		virtual bool				bind(const YEndPoint& endPoint) = 0;
		virtual SOCKET			getSocket() const = 0;
		virtual bool				sendto(const YEndPoint& toEndPoint, PACKET_SPTR packet, ISendToCallback& callback) = 0;
		
		virtual bool				recvfrom(IRecvFromCallback& callback) = 0;
		virtual void				shutdown() = 0;
		virtual void				close() = 0;
		virtual void				addRef() = 0;
	};
}